import time

import requests
from lxml import etree
from bs4 import BeautifulSoup

url = 'https://www.bigee.cc/xuanhuan/'
res = requests.get(url=url)
res = res.text
soup = BeautifulSoup(res, features='lxml')
beautiful_soup = soup.prettify()
print(beautiful_soup)
html_tree = etree.HTML(beautiful_soup)
books = html_tree.xpath("//div[@class='item']")
for book in books:
    title = book.xpath(".//dl/dt/a/text()")
    author = book.xpath(".//dl/dt/span/text()")
    img = book.xpath(".//div[@class='image']/a/img")[0]
    # print(dir(img))
    img_src = img.attrib.get("src")

    print(title[0].strip(), author[0].strip(), img_src)
    time.sleep(1)
    # break
